package com.dkasza.qicky;

/** This interface is used by the HttpServer to handle dynamic pages.
 *  The application has to provide a prefix and a request handler function.
 *  For all each request where the path start with the prefix, the request 
 *  handler will be called and the response string will be sent to the client.
 */
public interface HttpRequestHandler {
    
    /** Method to get the URI prefix for this request handler.
     *
     * @return URI prefix
     */
    public String prefix();
    
    /** Main function of the HttpRequestHandler class.
     *  Generates a response to a given request.
     * @param request http request data
     * @return http response
     */
    public Http.Response handler(Http.Request request);
}
